<%@page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>*</title>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/examples/private.js"></script>
</head>
<body>
	<div class="post">
		<div class="clearfix" style="margin-bottom: 20px;">
			<div class="info">
				<h2>
					<a
						href="http://www.quizzpot.com/2009/03/metodos-privados-y-metodos-privilegiados/">Métodos
						privados y métodos privilegiados</a>
				</h2>
				<span class="smalltext">Mar 12, 2009 | <a
					href="http://www.quizzpot.com/category/es/" title="Español">Español</a>
					| By <a href="http://www.quizzpot.com/author/admin/"
					title="Posts by Crysfel" rel="author">Crysfel</a> | <a
					href="http://www.quizzpot.com/2009/03/metodos-privados-y-metodos-privilegiados/#comments"
					title="Comment on Métodos privados y métodos privilegiados">12
						Comments</a> | <a
					href="http://www.quizzpot.com/2009/04/private-methods-and-privileged-methods/">Read
						in English</a>
				</span>
				<p>Este es un tema desconocido por muchos desarrolladores,
					algunos creen que esto no es posible hacerlo con JavaScript. En el
					tema de hoy veremos como ocultar propiedades y métodos en un
					objeto.</p>
			</div>
			<div class="tns">
				<div>
					<a
						href="http://www.quizzpot.com/2009/03/metodos-privados-y-metodos-privilegiados/"><img
						src="http://www.quizzpot.com/wp-content/uploads/2009/03/stop.jpg"
						alt="Métodos privados y métodos privilegiados"></a>
				</div>
			</div>
		</div>

		<div class="author clearfix">
			<img alt=""
				src="http://1.gravatar.com/avatar/7344c04fee0e5535e239b2a83623041a?s=80&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D80&amp;r=G"
				class="avatar avatar-80 photo" height="80" width="80"> <strong>Author:
				<a href="http://www.crysfel.com ">Crysfel</a>
			</strong>
			<p>
				I'm a software developer with 6+ years of experience, when I'm not
				developing software I may be writing a tutorial, you can follow me
				on <a href="http://twitter.com/crysfel">twitter</a>
			</p>
		</div>

		<div class="control-panel">
			<p class="clearfix">
				<a
					href="http://www.quizzpot.com/wp-content/uploads/2009/03/private-src.zip"
					class="btn download"><span>Download</span></a>
			</p>
		</div>


		<h3>Propiedades y métodos privados</h3>
		<p>Para crear propiedades o métodos privados lo hacemos en el
			constructor. Los parámetros y variables ordinarias (las que se crean
			utilizando la palabra reservada “var”) así como los parámetros son
			propiedades privadas las cuales no pueden ser utilizadas desde el
			exterior del objeto. Los métodos privados son funciones dentro del
			constructor, este tipo de funciones no serán expuestas fuera del
			objeto. Veamos el siguiente ejemplo:</p>
		<div class="dp-highlighter">
			<div class="bar">
				<div class="tools">
					<a href="#"
						onclick="dp.sh.Toolbar.Command('ViewSource',this);return false;">view
						plain</a><a href="#"
						onclick="dp.sh.Toolbar.Command('CopyToClipboard',this);return false;">copy
						to clipboard</a><a href="#"
						onclick="dp.sh.Toolbar.Command('PrintSource',this);return false;">print</a><a
						href="#"
						onclick="dp.sh.Toolbar.Command('About',this);return false;">?</a>
				</div>
			</div>
			<ol start="1" class="dp-c">
				<li class="alt"><span><span class="comment">//The&nbsp;object&nbsp;User</span><span>&nbsp;&nbsp;</span></span></li>
				<li class=""><span><span class="keyword">var</span><span>&nbsp;User&nbsp;=&nbsp;</span><span
						class="keyword">function</span><span>(options){&nbsp;&nbsp;</span></span></li>
				<li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;<span
						class="comment">//private&nbsp;properties</span><span>&nbsp;&nbsp;</span></span></li>
				<li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;<span
						class="keyword">var</span><span>&nbsp;name&nbsp;=&nbsp;options.name;&nbsp;&nbsp;</span></span></li>
				<li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;<span
						class="keyword">var</span><span>&nbsp;password&nbsp;=&nbsp;options.password;&nbsp;&nbsp;</span></span></li>
				<li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;<span
						class="comment">//public&nbsp;property</span><span>&nbsp;&nbsp;</span></span></li>
				<li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;<span
						class="keyword">this</span><span>.user&nbsp;=&nbsp;options.user;&nbsp;&nbsp;</span></span></li>
				<li class=""><span>&nbsp;&nbsp;</span></li>
				<li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;<span
						class="comment">//private&nbsp;method</span><span>&nbsp;&nbsp;</span></span></li>
				<li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;<span
						class="keyword">function</span><span>&nbsp;privateMethod(){&nbsp;&nbsp;</span></span></li>
				<li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;console.debug(<span
						class="string">'im&nbsp;a&nbsp;private&nbsp;method!'</span><span>)&nbsp;&nbsp;</span></span></li>
				<li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li>
				<li class="alt"><span>}&nbsp;&nbsp;</span></li>
				<li class=""><span>&nbsp;&nbsp;</span></li>
				<li class="alt"><span><span class="comment">//new&nbsp;instance&nbsp;of&nbsp;User</span><span>&nbsp;&nbsp;</span></span></li>
				<li class=""><span><span class="keyword">var</span><span>&nbsp;u&nbsp;=&nbsp;</span><span
						class="keyword">new</span><span>&nbsp;User({name:</span><span
						class="string">'Crysfel'</span><span>,password:</span><span
						class="string">'***'</span><span>,user:</span><span class="string">'cvilla'</span><span>});&nbsp;&nbsp;</span></span></li>
				<li class="alt"><span>&nbsp;&nbsp;</span></li>
				<li class=""><span>console.debug(u.user);&nbsp;<span
						class="comment">//cvilla</span><span>&nbsp;&nbsp;</span></span></li>
				<li class="alt"><span>console.debug(u.name);&nbsp;<span
						class="comment">//undefined</span><span>&nbsp;&nbsp;</span></span></li>
				<li class=""><span>console.debug(u.privateMethod());&nbsp;<span
						class="comment">//throws&nbsp;error</span><span>&nbsp;&nbsp;</span></span></li>
			</ol>
		</div>
		<pre name="code" class="javascript" style="display: none;">//The object User
var User = function(options){
	//private properties
	var name = options.name;
	var password = options.password;
	//public property
	this.user = options.user;

	//private method
	function privateMethod(){
		console.debug('im a private method!')
	}
}

//new instance of User
var u = new User({name:'Crysfel',password:'***',user:'cvilla'});

console.debug(u.user); //cvilla
console.debug(u.name); //undefined
console.debug(u.privateMethod()); //throws error
</pre>
		<p>En el ejemplo anterior se han agregado dos propiedades y un
			método privado, cuando intentamos imprimirlos en la consola de
			Firebug podemos ver que no se imprimen y el método lanza un error;
			esta es la manera en como se oculta la información dentro de un
			objeto.</p>
		<h3>Métodos privilegiados</h3>
		<p>Douglas Crockford le llama métodos privilegiados a los métodos
			que son públicos y que a la vez pueden acceder a las propiedades
			privadas y manipularlas, estos métodos son creados dinámicamente pues
			son agregados al objeto en tiempo de ejecución. Veamos un ejemplo:</p>
		<div class="dp-highlighter">
			<div class="bar">
				<div class="tools">
					<a href="#"
						onclick="dp.sh.Toolbar.Command('ViewSource',this);return false;">view
						plain</a><a href="#"
						onclick="dp.sh.Toolbar.Command('CopyToClipboard',this);return false;">copy
						to clipboard</a><a href="#"
						onclick="dp.sh.Toolbar.Command('PrintSource',this);return false;">print</a><a
						href="#"
						onclick="dp.sh.Toolbar.Command('About',this);return false;">?</a>
				</div>
			</div>
			<ol start="1" class="dp-c">
				<li class="alt"><span><span class="keyword">var</span><span>&nbsp;Person&nbsp;=&nbsp;</span><span
						class="keyword">function</span><span>(options){&nbsp;&nbsp;</span></span></li>
				<li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;<span
						class="comment">//private&nbsp;properties</span><span>&nbsp;&nbsp;</span></span></li>
				<li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;<span
						class="keyword">var</span><span>&nbsp;name&nbsp;=&nbsp;options.name&nbsp;&nbsp;</span></span></li>
				<li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;<span
						class="keyword">var</span><span>&nbsp;birthYear&nbsp;=&nbsp;options.birthYear;&nbsp;&nbsp;</span></span></li>
				<li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;<span
						class="comment">//private&nbsp;method</span><span>&nbsp;&nbsp;</span></span></li>
				<li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;<span
						class="keyword">var</span><span>&nbsp;calculateAge&nbsp;=&nbsp;</span><span
						class="keyword">function</span><span>(){&nbsp;&nbsp;</span></span></li>
				<li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span
						class="keyword">var</span><span>&nbsp;today&nbsp;=&nbsp;</span><span
						class="keyword">new</span><span>&nbsp;Date();&nbsp;&nbsp;</span></span></li>
				<li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span
						class="keyword">return</span><span>&nbsp;today.getFullYear()&nbsp;-&nbsp;birthYear;&nbsp;&nbsp;</span></span></li>
				<li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li>
				<li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;<span
						class="comment">//Privileged&nbsp;method</span><span>&nbsp;&nbsp;</span></span></li>
				<li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;<span
						class="keyword">this</span><span>.getAge&nbsp;=&nbsp;</span><span
						class="keyword">function</span><span>(){&nbsp;&nbsp;</span></span></li>
				<li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span
						class="keyword">return</span><span>&nbsp;calculateAge();&nbsp;</span><span
						class="comment">//calling&nbsp;private&nbsp;method</span><span>&nbsp;&nbsp;</span></span></li>
				<li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li>
				<li class=""><span>&nbsp;}&nbsp;&nbsp;</span></li>
				<li class="alt"><span>&nbsp;&nbsp;</span></li>
				<li class=""><span>&nbsp;<span class="comment">//new&nbsp;Person&nbsp;&nbsp;instance</span><span>&nbsp;&nbsp;</span></span></li>
				<li class="alt"><span>&nbsp;<span class="keyword">var</span><span>&nbsp;p&nbsp;=&nbsp;</span><span
						class="keyword">new</span><span>&nbsp;Person({name:</span><span
						class="string">'Peter'</span><span>,&nbsp;birthYear:1983});&nbsp;&nbsp;</span></span></li>
				<li class=""><span>&nbsp;&nbsp;</span></li>
				<li class="alt"><span>&nbsp;console.debug(p.getAge());<span
						class="comment">//&nbsp;the&nbsp;age</span><span>&nbsp;&nbsp;</span></span></li>
				<li class=""><span>&nbsp;console.debug(p.name);<span
						class="comment">//&nbsp;undefined</span><span>&nbsp;&nbsp;</span></span></li>
				<li class="alt"><span>&nbsp;console.debug(p.&nbsp;birthYear);<span
						class="comment">//&nbsp;undefined</span><span>&nbsp;&nbsp;</span></span></li>
			</ol>
		</div>
		<pre name="code" class="javascript" style="display: none;">var Person = function(options){
	//private properties
	var name = options.name
	var birthYear = options.birthYear;
	//private method
	var calculateAge = function(){
		var today = new Date();
		return today.getFullYear() - birthYear;
	}
	//Privileged method
	this.getAge = function(){
		return calculateAge(); //calling private method
	}
 }

 //new Person  instance
 var p = new Person({name:'Peter', birthYear:1983});

 console.debug(p.getAge());// the age
 console.debug(p.name);// undefined
 console.debug(p. birthYear);// undefined
</pre>
		<p>Los métodos privilegiados son una excelente herramienta y muy
			importantes para poder acceder a la información privada, de esta
			manera es como exponemos la información que sea necesaria. Es
			importante mencionar que los métodos privilegiados son creados en
			tiempo de ejecución pues están en el constructor del objeto y no en
			el prototipo (prototype object), en el siguiente ejemplo vamos a
			crear dinámicamente getter y setters para las propiedades que recibe
			el constructor mediante el parámetro “options”.</p>
		<div class="dp-highlighter">
			<div class="bar">
				<div class="tools">
					<a href="#"
						onclick="dp.sh.Toolbar.Command('ViewSource',this);return false;">view
						plain</a><a href="#"
						onclick="dp.sh.Toolbar.Command('CopyToClipboard',this);return false;">copy
						to clipboard</a><a href="#"
						onclick="dp.sh.Toolbar.Command('PrintSource',this);return false;">print</a><a
						href="#"
						onclick="dp.sh.Toolbar.Command('About',this);return false;">?</a>
				</div>
			</div>
			<ol start="1" class="dp-c">
				<li class="alt"><span><span class="keyword">var</span><span>&nbsp;Animal&nbsp;=&nbsp;</span><span
						class="keyword">function</span><span>(options){&nbsp;&nbsp;</span></span></li>
				<li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;<span
						class="comment">//a&nbsp;private&nbsp;method&nbsp;to&nbsp;do&nbsp;the&nbsp;job</span><span>&nbsp;&nbsp;</span></span></li>
				<li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;<span
						class="comment">//and&nbsp;to&nbsp;create&nbsp;a&nbsp;new&nbsp;scope&nbsp;(see&nbsp;last&nbsp;chapter&nbsp;of&nbsp;this&nbsp;course)</span><span>&nbsp;&nbsp;</span></span></li>
				<li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;<span
						class="keyword">function</span><span>&nbsp;createGetterAndSetters(properties,property){&nbsp;&nbsp;</span></span></li>
				<li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span
						class="comment">//attach&nbsp;the&nbsp;getter&nbsp;for&nbsp;the&nbsp;current&nbsp;property</span><span>&nbsp;&nbsp;</span></span></li>
				<li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span
						class="keyword">this</span><span>[</span><span class="string">'get'</span><span>+property]&nbsp;=&nbsp;</span><span
						class="keyword">function</span><span>(){&nbsp;&nbsp;</span></span></li>
				<li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span
						class="keyword">return</span><span>&nbsp;properties[property];&nbsp;&nbsp;</span></span></li>
				<li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li>
				<li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span
						class="comment">//attach&nbsp;the&nbsp;setter&nbsp;for&nbsp;the&nbsp;current&nbsp;property</span><span>&nbsp;&nbsp;</span></span></li>
				<li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span
						class="keyword">this</span><span>[</span><span class="string">'set'</span><span>+property]&nbsp;=&nbsp;</span><span
						class="keyword">function</span><span>(value){&nbsp;&nbsp;</span></span></li>
				<li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;properties[property]&nbsp;=&nbsp;value;&nbsp;&nbsp;</span></li>
				<li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li>
				<li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li>
				<li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;<span
						class="comment">//iterate&nbsp;through&nbsp;the&nbsp;options</span><span>&nbsp;&nbsp;</span></span></li>
				<li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;<span
						class="keyword">for</span><span>(</span><span class="keyword">var</span><span>&nbsp;property&nbsp;</span><span
						class="keyword">in</span><span>&nbsp;options){&nbsp;&nbsp;</span></span></li>
				<li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span
						class="comment">//call&nbsp;the&nbsp;private&nbsp;method&nbsp;with&nbsp;the&nbsp;right&nbsp;context</span><span>&nbsp;&nbsp;</span></span></li>
				<li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;createGetterAndSetters.call(<span
						class="keyword">this</span><span>,options,property);&nbsp;&nbsp;</span></span></li>
				<li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li>
				<li class="alt"><span>}&nbsp;&nbsp;</span></li>
				<li class=""><span>&nbsp;&nbsp;</span></li>
				<li class="alt"><span><span class="comment">//two&nbsp;different&nbsp;instances&nbsp;of&nbsp;Animal&nbsp;object</span><span>&nbsp;&nbsp;</span></span></li>
				<li class=""><span><span class="keyword">var</span><span>&nbsp;zul&nbsp;=&nbsp;</span><span
						class="keyword">new</span><span>&nbsp;Animal({breed:</span><span
						class="string">'Chihuahua'</span><span>,gender:</span><span
						class="string">'female'</span><span>,name:</span><span
						class="string">'Zul'</span><span>});&nbsp;&nbsp;</span></span></li>
				<li class="alt"><span><span class="keyword">var</span><span>&nbsp;rocky&nbsp;=&nbsp;</span><span
						class="keyword">new</span><span>&nbsp;Animal({breed:</span><span
						class="string">'Beagle'</span><span>,gender:</span><span
						class="string">'male'</span><span>,name:</span><span
						class="string">'Rocky'</span><span>});&nbsp;&nbsp;</span></span></li>
				<li class=""><span>&nbsp;&nbsp;</span></li>
				<li class="alt"><span>console.debug(zul.getbreed());<span
						class="comment">//Chihuahua</span><span>&nbsp;&nbsp;</span></span></li>
				<li class=""><span>console.debug(zul.getname());<span
						class="comment">//Zul</span><span>&nbsp;&nbsp;</span></span></li>
				<li class="alt"><span>console.debug(zul.name);<span
						class="comment">//undefined</span><span>&nbsp;&nbsp;</span></span></li>
				<li class=""><span>console.debug(rocky.getbreed());<span
						class="comment">//Beagle</span><span>&nbsp;&nbsp;</span></span></li>
				<li class="alt"><span>console.debug(rocky.getgender());<span
						class="comment">//male</span><span>&nbsp;&nbsp;</span></span></li>
				<li class=""><span>console.debug(rocky.getname());<span
						class="comment">//Rocky</span><span>&nbsp;&nbsp;</span></span></li>
				<li class="alt"><span>console.debug(rocky.breed);<span
						class="comment">//undefined</span><span>&nbsp;&nbsp;</span></span></li>
			</ol>
		</div>
		<pre name="code" class="javascript" style="display: none;">var Animal = function(options){
	//a private method to do the job
	//and to create a new scope (see last chapter of this course)
	function createGetterAndSetters(properties,property){
		//attach the getter for the current property
		this['get'+property] = function(){
			return properties[property];
		}
		//attach the setter for the current property
		this['set'+property] = function(value){
			properties[property] = value;
		}
	}
	//iterate through the options
	for(var property in options){
		//call the private method with the right context
		createGetterAndSetters.call(this,options,property);
	}
}

//two different instances of Animal object
var zul = new Animal({breed:'Chihuahua',gender:'female',name:'Zul'});
var rocky = new Animal({breed:'Beagle',gender:'male',name:'Rocky'});

console.debug(zul.getbreed());//Chihuahua
console.debug(zul.getname());//Zul
console.debug(zul.name);//undefined
console.debug(rocky.getbreed());//Beagle
console.debug(rocky.getgender());//male
console.debug(rocky.getname());//Rocky
console.debug(rocky.breed);//undefined
</pre>
		<p>
			En el ejemplo anterior se crean dinámicamente los getters y setters
			de las propiedades que se reciben como parámetro en el constructor,
			haciendo uso de un método privado para realizar el trabajo además de
			crear un nuevo <a
				href="http://www.quizzpot.com/2009/03/que-es-el-scope-o-alcance-de-una-variable/">scope</a>
			cuando se manda a ejecutar permitiendo de esta forma acceder a los
			valores correctos, (si tienes alguna duda de este concepto te
			recomiendo leer el tema donde se ha explicado con mayor detalle el
			concepto del scope y el problema que existe cuando creamos
			dinámicamente métodos). Otro punto importante de comentar es en el
			ciclo for, ya que estamos invocando al método privado asignándole el
			contexto adecuado, de esta manera nos aseguramos que la variable
			“this” dentro del método privado esté haciendo referencia al objeto
			“Animal” (si tienes dudas al respecto te recomiendo leer el tema
			sobre el contexto).
		</p>
		<h3>Conclusiones</h3>
		<p>
			Es posible crear métodos y propiedades privadas así como los métodos
			privilegiados gracias a los “<a
				href="http://www.quizzpot.com/2009/03/que-son-los-closures/">closures</a>”
			que maneja JavaScript, ya que es posible acceder a las variables
			externas de la función contenedora aún cuando ésta haya finalizado su
			ejecución.
		</p>
		<p>
			Lo métodos privados y privilegiados solo pueden ser definidos en el
			constructor (por los conceptos mencionados anteriormente), los <a
				href="http://www.quizzpot.com/2009/03/creacion-de-objetos-y-metodos-publicos/">métodos
				públicos</a> pueden ser agregados en cualquier momento utilizando el
			objeto “prototype”.
		</p>
		<p>
			Hemos visto como ocultar la información en un objeto, además de que
			hemos utilizado varios conceptos de temas anteriores como <a
				href="http://www.quizzpot.com/2009/03/que-es-el-scope-o-alcance-de-una-variable/">el
				scope</a>, <a
				href="http://www.quizzpot.com/2009/03/el-contexto-y-la-variable-this/">el
				contexto</a>, <a
				href="http://www.quizzpot.com/2009/03/que-son-los-closures/">closures</a>;
			es importante tener en cuenta estos conceptos pues los utilizaremos
			más adelante. También veremos algunas utilerias que Ext JS nos
			proporciona para manejar de manera más sencilla estos términos.
		</p>
		<p>Como siempre son bienvenidas las críticas, sugerencias, dudas o
			comentarios y por supuesto los votos en Digg o en tu red social
			favorita.</p>
		<div class="wp_twitter_button"
			style="float: right; margin-left: 10px;">
			<iframe
				src="http://platform.twitter.com/widgets/tweet_button.html#_=1323062098228&amp;count=horizontal&amp;counturl=http%3A%2F%2Fwww.quizzpot.com%2F2009%2F03%2Fmetodos-privados-y-metodos-privilegiados%2F&amp;id=twitter-widget-0&amp;lang=en&amp;original_referer=http%3A%2F%2Fwww.quizzpot.com%2F2009%2F03%2Fmetodos-privados-y-metodos-privilegiados%2F&amp;text=M%C3%A9todos%20privados%20y%20m%C3%A9todos%20privilegiados%20%C2%BB%20Quizzpot&amp;url=http%3A%2F%2Fwww.quizzpot.com%2F2009%2F03%2Fmetodos-privados-y-metodos-privilegiados%2F&amp;via=quizzpot"
				allowtransparency="true" frameborder="0" scrolling="no"
				class="twitter-share-button twitter-count-horizontal"
				style="width: 110px; height: 20px;"
				title="Twitter For Websites: Tweet Button"></iframe>
		</div>
		<iframe
			src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.quizzpot.com%2F2009%2F03%2Fmetodos-privados-y-metodos-privilegiados%2F&amp;layout=standard&amp;show_faces=true&amp;width=300&amp;height=25&amp;action=like&amp;font=trebuchet ms&amp;colorscheme=light"
			id="fbLikeIframe" name="fbLikeIframe" scrolling="no" frameborder="0"
			allowtransparency="true" class="fbLikeContainer"
			style="border: none; overflow: hidden; width: 300px; height: 25px; display: inline;"></iframe>
	</div>
</body>
</html>